package cn.edu.fudan.bdke.ncov.web.controller;

import cn.edu.fudan.bdke.ncov.qa.SemanticQa;
import cn.edu.fudan.bdke.ncov.qa.TemplateBasedQaBuilder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author xym
 * @since 1.0
 */
@RestController
@RequestMapping(value = "/qa")
public class QaController {
    private static final SemanticQa qa = new SemanticQa(new TemplateBasedQaBuilder());

    @GetMapping(value = "/debug")
    public List<String> debug1(@RequestParam("question") String question) {
        return qa.run(question);
    }
}
